
public class Sum {

	public static void main(String[] args){
		int a = sum(10);
		System.out.println(a);
		int b = sum(100);
		System.out.println(b);
	}
	
	public static int sum(int n){
		if(n == 1)
			return 1;
		int a = n + sum(n-1);
		return a;
	}
	public static int sum1(int m){
		if(m == 1)
			return 1;
		int b = m + sum(m-1/2);
		return b;
	}
}

